
<!DOCTYPE html>
<html>

<head>
   
    
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!--360浏览器优先以webkit内核解析-->


<title>添加日常费用报销明细</title>

<link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
<link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="__STATIC__/layout/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
<link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
<link href="__STATIC__/layout/css/channel.css?v=4.1.0" rel="stylesheet">
<!-- Sweet Alert -->
<link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <style>

    </style>

</head>

<body class="white-bg" style="padding: 3px;font-size: 12px">
    <div class="page-heade">
       <h2 class="title_color text-center">添加日常费用报销明细</h2>
    </div>
    <form action="" class="form-inline" id="form1">
        <table class="table table-bordered bud_hei">
            <tr class="info text-center">
                <td rowspan="2"><button class="btn btn-sm btn-primary" type="button">添加</button></td>
                <td colspan="2">时间</td>
                <td rowspan="2">出发地点</td>
                <td rowspan="2">到达地点</td>
                <td rowspan="2">住宿费 <span class="colorRed">*</span></td>
                <td rowspan="2">费用说明</td>
                <td rowspan="2">费用计入经销商</td>
            </tr>
            <tr class="info text-center">
                <td>起 <span class="colorRed">*</span></td>
                <td>止 <span class="colorRed">*</span></td>
            </tr>
            <tr>
                <td><button type="button" class="btn btn-sm btn-danger delthis">删除</button></td>
                <td><input type="text" name="" class="form-control layer-date" style="width: 70%" id="start"></td>
                 <td><input type="text" name="" class="form-control  layer-date" style="width: 70%" id="end"></td>
                 <td>
                    <div class="form-group" style="min-width: 110px;width: 110px">
                     <div class="input-group">
                            <input id="area_id" type="text" placeholder="请输入关键字或空格查询"
                                   class="form-control" value="" >
                            <div class="input-group-btn">
                                <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                </ul>
                            </div>
                        </div>
                    </div>
                    <a href="javascript:;" id="select_area">选择</a>  
                 </td>
                  <td>
                    <div class="form-group"  style="min-width: 110px;width: 110px">
                     <div class="input-group" >
                            <input id="area_id" type="text" placeholder="请输入关键字或空格查询"
                                   class="form-control" value="">
                            <div class="input-group-btn">
                                <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                </ul>
                            </div>
                        </div>
                    </div>
                    <a href="javascript:;" id="select_area">选择</a>  
                 </td>
                 <td style="min-width: 190px;width: 190px"><input type="text" name="" class="form-control" style="width: 30%">元</td>
                 <td><input type="text" name="" class="form-control" style="width: 50%"></td>
                 <td>
                      <div class="form-group" style="min-width: 110px;width: 110px">
                     <div class="input-group">
                            <input id="area_id" type="text" placeholder="请输入关键字或空格查询"
                                   class="form-control" value="">
                            <div class="input-group-btn">
                                <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                </ul>
                            </div>
                        </div>
                    </div>
                    <a href="javascript:;" id="select_area">选择</a>  
                 </td>
            </tr>
        </table>

        <div class="padding-10 text-center"><button class="btn btn-primary save" type="submit">保存并返回</button><span class="lr_5"></span><button class="btn btn-warning" type="button" id="fanhui">返回</button></div>
    </form>
  
    
<!-- 全局js -->
<script src="__STATIC__/layout/js/jquery.min.js"></script>
<script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
<!-- Sweet alert -->
<script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="__STATIC__/layout/js/plugins/suggest/bootstrap-suggest.min.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
<script>
    $(function () {
        $('body').on('click','input[type=text]',function () {
            this.select()
        })
           $('#fanhui').on('click',function () {
//                    parent.layer.close(parent.layer.getFrameIndex(window.name))
                    parent.location.reload();
                    return false
                })
    })
        $(document).on("click",".delthis",function(){
                 swal({
                            title: "提示",
                            text: "您真的要删除么？",
                            type: "warning",
                            showCancelButton: true,
                            confirmButtonColor: "#FF3333",
                            confirmButtonText: "确定",
                            cancelButtonText: "取消",
                            closeOnConfirm: true
                        })
                        // function (isConfirm) {
                        //   if (isConfirm) {
                        //    //alert(cid);
                        //     $.post("/index/productsseries/dropser.html",{sid:sid},function(re){
                        //       //alert(re);
                        //         if(re==1){
                        //             swal({
                        //             title: "完成",
                        //             text:  "系列已删除",
                        //             type: "success"
                        //             },function(){
                        //                 location.href='/index/productsseries/series.html';
                                        
                        //             });
                        //         }else{
                        //              swal({
                        //             title: "错误",
                        //             text:  "系统繁忙请稍后再试",
                        //             type: "warning"
                        //             });
                        //         }
                        //     })
                        // }
                        // })

        })

          $('.save').on('click',function () {
        var param = $(this).closest('form').serialize();
        if($("#start").val()==""){
            swal("","请选择报销开始时间","error")
        }else if($("#end")==0){
             swal("","请选择报销结束时间","error") 
        }else if($("#end")==0){
             swal("","请选择报销结束时间","error") 
        }else{
               $.post('',param,function (data) {
            if(data.success){
                swal({title:data.msg},function () {
                    location.href='/index/wdxsdd/index.html'
                })
            }else{
                swal(data.msg)
            }
        },'json')
        return false;
        }
     

    })
</script>

<script>
      //日期范围限制
        var start = {
            elem: '#start',
            format: 'YYYY/MM/DD',
            min: laydate.now(), //设定最小日期为当前日期
            max: '2099-06-16 23:59:59', //最大日期
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#end',
            format: 'YYYY/MM/DD',
            min: laydate.now(),
            max: '2099-06-16 23:59:59',
            istime: true,
            istoday: false,
            choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        laydate(start);
        laydate(end);
  
  var jieshou = $("#area_id");
 sousuo(jieshou);
       function sousuo(id){
            id.bsSuggest({
            allowNoKeyword: false, //是否允许无关键字时请求数据
            multiWord: true, //以分隔符号分割的多关键字支持
            separator: ",", //多关键字支持时的分隔符，默认为空格
            getDataMethod: "url", //获取数据的方式，总是从 URL 获取
            url: 'http://unionsug.baidu.com/su?p=3&t=' + (new Date()).getTime() + '&wd=',
            /*优先从url ajax 请求 json 帮助数据，注意最后一个参数为关键字请求参数*/
            jsonp: 'cb',
            /*如果从 url 获取数据，并且需要跨域，则该参数必须设置*/
            processData: function (json) { // url 获取数据时，对数据的处理，作为 getData 的回调函数
                var i, len, data = {
                    value: []
                };
                if (!json || !json.s || json.s.length === 0) {
                    return false;
                }

                // console.log(json);
                len = json.s.length;

                jsonStr = "{'value':[";
                for (i = 0; i < len; i++) {
                    data.value.push({
                        word: json.s[i]
                    });
                }
                data.defaults = 'baidu';

                //字符串转化为 js 对象
                return data;
            }
        });

          }
/*$("#addcostbx").click(function(){
    if($("#payWay option").val()==0){
       swal("", "请选择支付方式！", "error")
    }else if($("#threeproject").text()==""){
        swal("", "三级费用科目不能为空！", "error")
    }else if($("#bxcause").val()==""){
        swal("", "报销事由不能为空！", "error")
    }else{
          layer.open({
                type: 2,
                title: '添加日常费用报销明细',
                 area: ['1200px', '600px'],
                fixed: false, //不固定
                maxmin: true,
                content: "{:url('Other/addcostbxDetail')}"
            });
            return false

    }
})*/
</script>
</body>

</html>